/*
 * JActivationStack.java
 *
 * Created on 15 de marzo de 2008, 15:03
 */

package org.perfectday.main.dummyengine.model;

import java.awt.Label;
import java.util.List;
import org.perfectday.logicengine.core.Game;
import org.perfectday.logicengine.model.activationstack.accidents.Accident;

/**
 *
 * @author  Miguel Angel Lopez Montellano ( alakat@gmail.com )
 */
public class JActivationStack extends javax.swing.JPanel {
    
    /** Creates new form JActivationStack */
    public JActivationStack() {
        initComponents();        
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();

        setLayout(new java.awt.GridLayout(10, 1));

        jLabel1.setText("Pila de activación");
        add(jLabel1);
    }// </editor-fold>//GEN-END:initComponents
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables
    public void stackRefresh(){
        this.removeAll();
        List<Accident> events = Game.getGame().getActivationStack().getStack();
        for (Accident accident : events) {
            this.add(new Label(accident.toString()));
        }
        this.repaint();
    }
}
